#pragma once
#include <iostream>
#include <chrono>
#include <cmath>
#include <thread>

namespace common_lib
{
class LibTime
{
public:
    static LibTime now();
    static void sleep(int second);
    // {
    //     LibTime test;
    //     test.time = std::chrono::system_clock::now();
    //     test.duration  = std::chrono::time_point_cast<std::chrono::nanoseconds>(test.time).time_since_epoch();
    //     return test;
    // }

    LibTime operator-(const LibTime &input);
    LibTime operator+(const int64_t & input);

    double toSec();

    double toNSec();
    int64_t getSec();
    int64_t getNSec();
private:
    std::chrono::time_point<std::chrono::system_clock> time;
    std::chrono::system_clock::duration duration;
};    
}

